
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.global.js"></script>
</head>

<body>
    <div class="app">
        <h3>切换图片</h3>
        <img :src="imgSrc" alt="" width="200" height="200" srcset="">
        <br>
        <button @click="changeSrc1">图片1</button>
        <button @click="changeSrc2">图片2</button>
    </div>
    <script>
        const { createApp } = Vue
        createApp({
            data() {
                return {
                    imgSrc:'./image/IMG_1050(20200921-153552).JPG'
                }
            },
            methods:{
                changeSrc1(){
                    this.imgSrc = './image/IMG_1050(20200921-153552).JPG'
                },
                changeSrc2(){
                    this.imgSrc = './image/IMG_1053(20200921-153627).JPG'
                }
            }
        }).mount('.app')
    </script>
</body>

</html>